<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>自定义显示当前的日期</title>
</head>

<body>
<script>
<!--
  var year, month , day, tempdate ;
  tempdate = new Date();
  year= tempdate.getFullYear();
  month= tempdate.getMonth() + 1 ;
  day = tempdate.getDate();
  document.write(year+"年"+month+"月"+day+"日"+"&nbsp;&nbsp;&nbsp;&nbsp;");
  var weekarray=new Array(7);
  weekarray[0]="星期日" ;
  weekarray[1]="星期一" ;
  weekarray[2]="星期二" ;
  weekarray[3]="星期三" ;
  weekarray[4]="星期四" ;
  weekarray[5]="星期五" ;
  weekarray[6]="星期六" ;	
  weekday=tempdate.getDay();
  document.write(weekarray[weekday]) ;
 // -->
</script>
</body>
</html>
